package com.example.administrator.xxnapp.bean;

import com.example.administrator.xxnapp.fragment.event.IModelEvent;
import com.example.administrator.xxnapp.http.HttpUrl;
import com.google.gson.Gson;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.request.GetRequest;
import com.lzy.okgo.request.PostRequest;

import java.io.Serializable;

/**
 * Created by Administrator on 2018/5/12.
 */

public class EventBean implements Serializable,IModelEvent{

    /**
     * id : 1
     * userId : 1
     * atUserId : 0
     * createDate : 123
     * content : 内容
     * describe : 描述
     */

    private int id;
    private int userId;
    private int atUserId;
    private long createDate;
    private String content;
    private String describe;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public int getAtUserId() {
        return atUserId;
    }

    public void setAtUserId(int atUserId) {
        this.atUserId = atUserId;
    }

    public long getCreateDate() {
        return createDate;
    }

    public void setCreateDate(long createDate) {
        this.createDate = createDate;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    @Override
    public GetRequest<String> getEvent(int userId) {
        return OkGo.<String>get(HttpUrl.GET_EVENT_URL+"/"+userId);
    }

    @Override
    public PostRequest<String> saveEvent(EventBean bean) {
        return OkGo.<String>post(HttpUrl.SAVE_EVENT_URL)
                .upJson(new Gson().toJson(bean).toString());
    }
}
